package com.invengo.testrfid.app.view;

import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;

import com.invengo.testrfid.R;

public class InputCageView extends LinearLayout {

    private PreOrNextView preOrNextView;
    private EditText tv_cage;

    public InputCageView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        View inflate = LayoutInflater.from(context).inflate(R.layout.view_input, this);
        preOrNextView = inflate.findViewById(R.id.pn_one);
        tv_cage = inflate.findViewById(R.id.tv_cage);
    }

    public void setPreOrNextClick(PreOrNextView.PreOrNextCallback preOrNextClick) {

        preOrNextView.initView(false,true);
        preOrNextView.setOnClickListenser(preOrNextClick);
    }

    public String getText() {
        return tv_cage.getText().toString();
    }


    public void clearText(){
        tv_cage.setText("");
    }

}
